import React from 'react';
import ReactDOM from 'react-dom';
import {mainRoutes} from './router/Router.js';
import { renderRoutes } from 'react-router-config';
import App from './App'
import {BrowserRouter as Router,Switch,Redirect, Route} from "react-router-dom";

ReactDOM.render(
    <Router>
        <Switch>
            <Route path={"/admin"} render = {routeProps=>{
                    return <App { ...routeProps  } />;
                   }}
            />
            {renderRoutes(mainRoutes)}
            <Redirect to="/error"/>
        </Switch>
    </Router>,
    document.getElementById('root')
);
